const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let n,k; // n表示数字个数, k表示连续和
let initArr = [];
rl.on("line", (line)=>{
    if(n === undefined) {
        [n, k] = line.trim().split(" ").map(Number)
    } else {
        initArr = line.trim().split(" ").map(Number)
        console.log(getResult(n, k, initArr))

        // clear
        n = k = undefined
        initArr.length = 0

    }
})

function getResult(n, k, initArr) {
    let count = 0
    for (let i = 0; i < initArr.length; i++) {
        let sum = 0
        for (let j = i; j < initArr.length ; j++) {
            sum += initArr[j]
            if(sum >= k) {
                count += (initArr.length - j)
                break
            }
        }
    }
    return count
}